/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.distribution.comment.dto.AchievementDataDto;
import com.yami.shop.distribution.comment.dto.DistributionUserAchievementDataDto;
import com.yami.shop.distribution.comment.dto.DistributionUserSimpleDto;
import com.yami.shop.distribution.comment.model.DistributionUser;
import com.yami.shop.distribution.comment.param.RangeTimeParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface DistributionUserMapper extends BaseMapper<DistributionUser> {

//    String getParentIdsByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    AchievementDataDto getAchievementDataDtoById(Long id);

    IPage<DistributionUser> distributionUserPage(Page page, @Param("distributionUser") DistributionUser distributionUser
            , @Param("rangeTimeParam") RangeTimeParam rangeTimeParam, @Param("mobile") String mobile
            , @Param("parentMobile") String parentMobile, @Param("sortChange") Integer sortChange);

    IPage<DistributionUser> getDistributionUserAchievementPage(Page page, @Param("distributionUser") DistributionUser distributionUser, @Param("userMobile") String userMobile);

    DistributionUserAchievementDataDto getLevelDistributionUserAchievementDataByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

//    Long getParentDistributionUserIdByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

//    String getUserIdByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    IPage<DistributionUserSimpleDto> getDistributionUserSimpleDtoByParentUserIdPage(Page page, @Param("parentDistributionUserId") Long parentDistributionUserId);

    /**
     * 修改等级
     */
    void updateLevel(@Param("distributionUserId") Long distributionUserId, @Param("level") Integer level);

    void replaceLevel(@Param("shopId") Long shopId, @Param("maxLevel") int maxLevel);

    List<DistributionUser> getDistributionUserByIdCardNumberAndUserMobile(@Param("identityCardNumber") String identityCardNumber, @Param("userMobile") String userMobile);

    List<String> listByMaxLevel(@Param("shopId") Long shopId, @Param("maxLevel") int level);


//     int getLevelIdByDistributionUserId(Long distributionUserId);
}
